stability: close validated audit findings remediation - #34
Merged
Conversation
Finalize the remaining audit follow-ups across bootstrap validation, uploader/sync hardening, and documentation clarity so every tracked finding is closed with rationale. Record full local validation matrix evidence to keep remediation outcomes auditable before PR handoff.
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
Extract uploader runtime templates into dedicated Starlark modules to remove the large inline script blocks from the rule implementation and improve maintainability. Harden go bootstrap validation with stricter path checks plus explicit MODULE.bazel existence verification, and update remediation docs accordingly.
Replace the zero-signal Bazel coverage check with a deterministic Python tooling coverage probe and add direct-run fallback path resolution for the Python tool tests. Make the integration gzip assertion rely on uploader behavior signals so Windows runs no longer fail on host gzip availability mismatches.
Allow the filter+gzip integration check to accept explicit uploader gzip debug evidence on Windows when request header capture is inconsistent across Git Bash and PowerShell boundaries. Keep strict gzip header enforcement for non-Windows platforms.
Set DD_TEST_OPTIMIZATION_GZIP and DD_TEST_OPTIMIZATION_FILTER_PREFIX explicitly in retry and error-path uploader scenarios so test expectations cannot drift from prior scenario state on Windows runners.
Suppress method return-value pipeline leakage in PowerShell upload helpers so failed HTTP retries return false reliably instead of being treated as success by callers.
Silence schema validator output streams and require strict boolean equality for upload outcomes so non-empty command streams cannot flip failure paths to success in Windows retry scenarios.
Normalize PowerShell upload success checks to evaluate only the final emitted value from helper functions so incidental stream items cannot cause false-positive upload success in Windows retry scenarios.
Pass compressed byte arrays to ByteArrayContent as a single constructor argument to avoid argument-expansion failures in Windows PowerShell.
Drop the temporary audit findings tracking document from the repository to keep project docs focused on user and maintainer guidance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
This PR completes a full remediation pass for validated repository findings from two independent deep audits, with emphasis on reliability, cross-platform behavior, test signal quality, and maintainability.
The work spans core Bazel/Starlark rules, the Go companion module, integration harness behavior, CI/security workflows, and user/maintainer docs.
What Changed
Uploader hardening and maintainability
tools/core/test_optimization_uploader.bzlinto dedicated template modules:tools/core/uploader_bash_template.bzltools/core/uploader_powershell_template.bzltools/core/uploader_batch_template.bzldd_payload_uploadermacro wrapper.Add()calls,ByteArrayContentconstructor usage for gzip payload bytes.Sync/multi-sync and bootstrap robustness
http_*timeout/retry knobs) so multi-service users can configure the same transport behavior as single-service users.MODULE.bazelexistence validation at target path).Go companion rule behavior
modules/go/topt_go_infer.bzlwith type checks.embed-only toembed+depsto reduce missed inference scenarios.dd_topt_go_testmodule selection inputs.rundirhandling to deterministic package-relative execution semantics.Test coverage and integration depth
sanitize_label_fragment,dedup_keys, logging helpers).CI/security workflow improvements
contents: read).actionsin addition topython.Documentation and examples alignment
DD_TEST_OPTIMIZATION_FILTER_PREFIX, HTTP-1semantics, multi-service uploader usage).Compatibility / Behavior Notes
Validation Matrix
./bazelw test //tools/..../bazelw build //examples/...cd modules/go && ../../bazelw test //... --override_module=datadog-rules-test-optimization=../..tools/tests/integration/run_mock_server_tests.shpython3 tools/dev/check_module_versions.py./bazelw test //tools/... --spawn_strategy=sandboxed --strategy=TestRunner=sandboxed --sandbox_default_allow_network=false --modify_execution_info=TestRunner=+block-network --test_env=TZ=UTC --test_env=LANG=C --test_env=LC_ALL=C --enable_runfilescd modules/go && ../../bazelw test //... --override_module=datadog-rules-test-optimization=../.. --spawn_strategy=sandboxed --strategy=TestRunner=sandboxed --sandbox_default_allow_network=false --modify_execution_info=TestRunner=+block-network --test_env=TZ=UTC --test_env=LANG=C --test_env=LC_ALL=C --enable_runfilesRisk / Rollback